package com.example.schoolguider.exception;

import com.example.schoolguider.common.ResultStatus;

/**
 * @author wjc
 * @date 2024/6/29 10:20
 */
public class MyException extends RuntimeException{
    private static final long serialVersionUID = 1L;

    private Object object;

    private ResultStatus resultStatus;

    public MyException(String msg) {
        super(msg);
    }

    public MyException(String msg, Object object) {
        super(msg);
        this.object = object;
    }

    public MyException(String msg, Throwable cause) {
        super(msg, cause);
    }


    public MyException(ResultStatus resultStatus) {
        super(resultStatus.getMessage());
        this.resultStatus = resultStatus;
    }

    public MyException(ResultStatus resultStatus, Object object) {
        super(resultStatus.getMessage());
        this.resultStatus = resultStatus;
        this.object = object;
    }


    public Object getObject() {
        return object;
    }

    public ResultStatus getResultStatus() {
        return resultStatus;
    }
}
